package com.sunshine.springboot.dto.system;

import com.sunshine.springboot.constant.ResultCode;

/**
 * Demo class
 *
 * @author WeiHong
 * @date 2018/8/14
 */
public class ResultGenerator {

    private static final String DEFAULT_SUCCESS_MESSAGE = "SUCCESS";

    public static Result successResult() {
        return new Result(ResultCode.SUCCESS, true, DEFAULT_SUCCESS_MESSAGE);
    }

    public static Result successResult(Object data) {
        return successResult().setData(data);
    }

    public static Result failResult(String message) {
        return new Result(ResultCode.FAIL, false, message);
    }
}
